@if( count($errors)==1 && $errors->all()[0] == $params['success'])
<script>
    var url = "{{ $params['url'] }}";
    $(document).ready(function () {
        swal({
            title: "添加成功",
            text: "您可以选择“继续添加”或“进入管理”页面",
            timer: 2000,
            type: "success",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "进入管理页面",
            cancelButtonText: "继续添加"
        },function (isConfirm) {
            if (isConfirm) {
                location.href=url;
                var index=parent.layer.getFrameIndex(window.name);
                // console.log(index);
                parent.layer.close(index);
            }
        });
    });
</script>
@endif
